package com.winenine999.generator.dao;

import com.winenine999.model.Winetype;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface WinetypeMapper {
    @Delete({
        "delete from winetype",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into winetype (id, name, ",
        "typedetail, pid)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{typedetail,jdbcType=VARCHAR}, #{pid,jdbcType=INTEGER})"
    })
    int insert(Winetype record);

    int insertSelective(Winetype record);

    @Select({
        "select",
        "id, name, typedetail, pid",
        "from winetype",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.winenine999.generator.dao.WinetypeMapper.BaseResultMap")
    Winetype selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Winetype record);

    @Update({
        "update winetype",
        "set name = #{name,jdbcType=VARCHAR},",
          "typedetail = #{typedetail,jdbcType=VARCHAR},",
          "pid = #{pid,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Winetype record);
}